package com.lyon.custom.example.controller;

import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LeeYan9
 * @since 2021-12-02
 */
@RestController
@RequestMapping("/example")
public class ExampleController implements EnvironmentAware {

    Environment environment;

    @RequestMapping("")
    public String get(String param) {
        return environment.getProperty(param);
    }

    @Override
    public void setEnvironment(Environment environment) {
        this.environment = environment;
    }
}
